package com.zhaoxi.project.fms.service.impl;

import com.zhaoxi.common.utils.DateUtils;
import com.zhaoxi.framework.web.BaseService;
import com.zhaoxi.project.fms.domain.FmsClassificationItem;
import com.zhaoxi.project.fms.mapper.FmsClassificationItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class FmsClassificationItemServiceImpl extends BaseService {
    @Autowired
    private FmsClassificationItemMapper fmsClassificationItemMapper;

    /**
     * 查询记账科目信息
     *
     * @param id 记账科目信息主键
     * @return 记账科目信息
     */

    public FmsClassificationItem selectFmsClassificationItemById(Long id) {
        return fmsClassificationItemMapper.selectFmsClassificationItemById(id);
    }

    /**
     * 查询记账科目信息列表
     *
     * @param fmsClassificationItem 记账科目信息
     * @return 记账科目信息
     */

    public List<FmsClassificationItem> selectFmsClassificationItemList(FmsClassificationItem fmsClassificationItem) {

        return   fmsClassificationItemMapper.selectFmsClassificationItemList(fmsClassificationItem);
    }

    /**
     * 新增记账科目信息
     *
     * @param fmsClassificationItem 记账科目信息
     * @return 结果
     */

    public int insertFmsClassificationItem(FmsClassificationItem fmsClassificationItem) {
        return fmsClassificationItemMapper.insertFmsClassificationItem(fmsClassificationItem);
    }

    /**
     * 修改记账科目信息
     *
     * @param fmsClassificationItem 记账科目信息
     * @return 结果
     */

    public int updateFmsClassificationItem(FmsClassificationItem fmsClassificationItem) {
        fmsClassificationItem.setUpdateTime(DateUtils.getNowDate());
        return fmsClassificationItemMapper.updateFmsClassificationItem(fmsClassificationItem);
    }


    /**
     * 批量删除记账科目信息
     *
     * @param ids 需要删除的记账科目信息主键
     * @return 结果
     */

    public int deleteFmsClassificationItemByCodes(Long[] ids) {
        return fmsClassificationItemMapper.deleteFmsClassificationItemByIds(ids);
    }

    /**
     * 删除记账科目信息信息
     *
     * @param id 记账科目信息主键
     * @return 结果
     */

    public int deleteFmsClassificationItemById(Long id) {
        return fmsClassificationItemMapper.deleteFmsClassificationItemById(id);
    }


}
